package jtacck.labmedicine;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Point;
import android.graphics.Paint.Style;
import android.location.Location;

import com.google.android.maps.GeoPoint;
import com.google.android.maps.MapView;
import com.google.android.maps.MyLocationOverlay;
import com.google.android.maps.Projection;

public class MyLocOverlay extends MyLocationOverlay {

    /**
     * The image that is drawn representing the accuracy of the Network/GPS.
     */
    private Paint accuracyPaint;

    /**
     * The center of the circle aka where we're at.
     */
    private Point center;

    /**
     * The left "side" of the circle so that we can calculate the radius.
     */
    private Point left;

    public MyLocOverlay(Context context, MapView mapView) {
        super(context, mapView);
    }

    @Override
    protected void drawMyLocation(Canvas canvas, MapView mapView,
            Location lastFix, GeoPoint myLocation, long when) {
        super.drawMyLocation(canvas, mapView, lastFix, myLocation, when);

        // /** Set the antialiasing and size of stroke **/
        // accuracyPaint = new Paint();
        // accuracyPaint.setAntiAlias(true);
        // accuracyPaint.setStrokeWidth(1.0f);
        //
        // /** Set up variables **/
        // center = new Point();
        // left = new Point();
        // double latitude;
        // double longitude;
        // float accuracy;
        // Projection projection = mapView.getProjection();
        //
        // /** Get attributes to the location **/
        // latitude = lastFix.getLatitude();
        // longitude = lastFix.getLongitude();
        // accuracy = lastFix.getAccuracy();
        //
        // float[] result = new float[1];
        //
        // Location.distanceBetween(latitude, longitude, latitude, longitude +
        // 1,
        // result);
        // float longitudeLineDistance = result[0];
        //
        // GeoPoint leftGeo = new GeoPoint(
        // (int) (latitude * 1E6),
        // (int) ((longitude - accuracy / (longitudeLineDistance * 2.5)) *
        // 1E6));
        // projection.toPixels(leftGeo, left);
        // projection.toPixels(myLocation, center);
        // int radius = center.x - left.x;
        //
        // /** Set color and style of each circle and it's location **/
        // accuracyPaint.setColor(0xff6666ff);
        // accuracyPaint.setStyle(Style.STROKE);
        // canvas.drawCircle(center.x, center.y, radius, accuracyPaint);
        //
        // accuracyPaint.setColor(0x186666ff);
        // accuracyPaint.setStyle(Style.FILL);
        // canvas.drawCircle(center.x, center.y, radius, accuracyPaint);
    }

}
